Socket
Socket
Sign inDemoInstall

which-pm-runs

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    which-pm-runs

Detects what package manager executes the process


Version published
Weekly downloads
2.2M
decreased by-2.99%
Maintainers
1
Install size
3.92 kB
Created
Weekly downloads
 

Package description

What is which-pm-runs?

The `which-pm-runs` npm package is designed to identify which package manager was used to invoke a script. This can be particularly useful in scenarios where scripts need to behave differently depending on the package manager (npm, yarn, pnpm, etc.) that is running them. It provides a simple API to detect the current package manager and can be used in various Node.js scripts to enhance cross-package manager compatibility.

What are which-pm-runs's main functionalities?

Detecting the package manager

This feature allows you to detect which package manager is currently running the script. The function returns an object containing the name and version of the package manager. This can be useful for scripts that need to adjust their behavior based on the package manager, such as using different command-line options or handling lock files differently.

const whichPMRuns = require('which-pm-runs');
console.log(whichPMRuns());

Other packages similar to which-pm-runs

Readme

Source

which-pm-runs

Detects what package manager executes the process

npm version

Supports npm, pnpm, Yarn, cnpm. And also any other package manager that sets the npm_config_user_agent env variable.

Installation

pnpm add which-pm-runs

Usage

'use strict'
const whichPMRuns = require('which-pm-runs')

whichPMRuns()
//> {name: "pnpm", version: "0.64.2"}
  • which-pm - Detects what package manager was used for installation

License

MIT © Zoltan Kochan

Keywords

FAQs

Last updated on 18 Feb 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc